package com.example.win.android_banduyujia.http;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;

/**
 * Created by Win on 2015/8/24.
 */
public class NetworkUtils {


    public NetworkUtils(){

    }

    public static boolean isNetWorkAvailable(Context context) {
        ConnectivityManager cManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
        NetworkInfo   info = cManager.getActiveNetworkInfo();
        if(info !=null && info.isAvailable()){
            return true;
        }else{
            return false;
        }
    }
}
